<template>
    <div class="container">
        <a-form layout="inline" :model="query" @submit="handleQuery">
            <a-form-item name="menuParentId" label="菜单名称">
                <a-input v-model:value="query.name" placeholder="请输入菜单名称" allow-clear @keyup.enter="handleQuery" />
            </a-form-item>
            <a-form-item>
                <a-button type="primary" @click="handleQuery">
                    <Icon icon="SearchOutlined" />
                    查询
                </a-button>
            </a-form-item>
        </a-form>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
// Component
import Icon from '@/component/common/Icon.vue';
// Model
import { MenuQuery } from '@/model/sys/menu';
// Plugin
import { Bus, BusEvent } from '@/plugin';

// 变量
const query = ref<MenuQuery>(new MenuQuery());

// 方法
const handleQuery = () => {
    Bus.emit(BusEvent.REFRESH_MENU, query.value);
};
</script>

<style lang="less" scoped></style>
